package com.saguitech.sgemeos.utils;

import java.util.Collection;
import java.util.Iterator;

public abstract class Filter<T> {
	public abstract boolean isAccepted(T t);
	
	public void filter(Collection<T> collection){
		Iterator<T> iterator = collection.iterator();
	    while (iterator.hasNext()) {
	        T t = iterator.next();
	        if (!isAccepted(t)) {
	            iterator.remove();
	        }
	    }

	}
}
